int partition(int elem[],int low,int high){
	int temp;
	while(low<high){
		while(low<high&& elem[high]>=elem[low])
			high--;
		temp=elem[low];
		elem[low]=elem[high];
		elem[high]=temp;
		while(low<high&& elem[low]<=elem[high])
			low++;
		temp=elem[low];
		elem[low]=elem[high];
		elem[high]=temp;
	}
	return low;
}
void quicksort(int elem[],int low,int high){
	if(low<high){
		int pivotloc=partition(elem,low,high);
		quicksort(elem,low,pivotloc);
		quicksort(elem,pivotloc+1,high);
	}
}
void quicksortAll(int elem[],int size){
	quicksort(elem,0,size-1);
}
int main(){
	int test[7]={2,6,8,10,-1,4,3};
	quicksortAll(test,7);
}